package org.ikit.twitter;

import java.util.Date;

public class TweetObject implements Comparable{
	
	final static int TWEET_TYPE_ORDINARY = 0;
	final static int TWEET_TYPE_RETWEET = 1;
	final static int TWEET_TYPE_MESSAGE = 2;

	String fromUser;
	String toUser;
	int fromUserId;
	int toUserId;
	String text;
	long timeSeconds;
	int type;
	
	public TweetObject() {
		
	}
	
	public TweetObject(String fromUser, int fromUserId, int toUserId, String text, long timeSeconds) {
		this.fromUser = fromUser;
		this.fromUserId = fromUserId;
		this.toUserId = toUserId;
		this.text = text;
		this.timeSeconds = timeSeconds;
	}
	
	public String getFromUser() {
		return fromUser;
	}
	public void setFromUser(String fromUser) {
		this.fromUser = fromUser;
	}
	public String getToUser() {
		return toUser;
	}
	public void setToUser(String toUser) {
		this.toUser = toUser;
	}
	public int getFromUserId() {
		return fromUserId;
	}
	public void setFromUserId(int fromUserId) {
		this.fromUserId = fromUserId;
	}
	public int getToUserId() {
		return toUserId;
	}
	public void setToUserId(int toUserId) {
		this.toUserId = toUserId;
	}
	public String getText() {
		return text;
	}
	public void setText(String text) {
		this.text = text;
	}
	public long getTimeSeconds() {
		return timeSeconds;
	}
	public void setTime(int timeSeconds) {
		this.timeSeconds = timeSeconds;
	}
	public int getType() {
		return type;
	}
	public void setType(int type) {
		this.type = type;
	}

	@Override
	/**
	 * Newer will be "bigger"
	 */
	public int compareTo(Object arg0) {
		return (int) (this.timeSeconds - ((TweetObject)arg0).getTimeSeconds());
	}
}
